package com.kktestspb.demo.services;

import com.kktestspb.demo.dao.VisitorDaoInt;
import com.kktestspb.demo.polo.Visitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author kk
 * @date 2019-09-01 20:49
 */
@Service
public class VisitorServices {


    @Autowired
    VisitorDaoInt visitorDaoInt;

    @Autowired
    Visitor visitor;


    /**
     * 插入来访者记录表
     * @param visitor
     */
    public void addVisitor(Visitor visitor){
        visitorDaoInt.insertVisitor(visitor);
    }

    /**
     * 获取所有来访者记录list
     * @return
     */
    public List<Visitor> getVisitors(){
        return visitorDaoInt.getVisitorList();
    }
}
